package com.tarena.test;

import java.awt.BorderLayout;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class LayoutDemo {
	public static void main(String[] args){
		JFrame frame = new JFrame();
		JPanel content = new JPanel(new BorderLayout());
		JPanel bottom = new JPanel();
		bottom.setLayout(new BorderLayout());
		JPanel right = new JPanel(new FlowLayout());
		JPanel left = new JPanel(new FlowLayout());
		JButton ok = new JButton("ok");
		JButton cancel = new JButton("cancel");
		JButton hide = new JButton("hide");
		left.add(hide);
		right.add(ok);
		right.add(cancel);
		bottom.add(BorderLayout.WEST,left);
		bottom.add(BorderLayout.EAST,right);
		content.add(BorderLayout.SOUTH,bottom);
		frame.add(content);
//		frame.setContentPane(content);
		frame.setSize(500,400);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
